package com.xinfan.io.printstream;

import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;

/**
 * @Author xin
 * @Date 2022/6/9 11:08
 * @Version 1.0
 */
public class PrintWriter_ {
    public static void main(String[] args) throws IOException {
//        PrintWriter writer = new PrintWriter(System.out);

        PrintWriter writer = new PrintWriter(new FileWriter("G:\\桌面\\kkk.txt"));
        writer.write("test");
        writer.close();//一定要关闭输出流 否则写不进去

    }
}
